      subroutine xaverage(nx,ny,cutoff,data,avg)
      real data(nx,ny),avg(ny),cutoff,rhoh

      do j = 1,ny
      avg(j) = 0.
      do i = 1,nx
      avg(j) = avg(j) + rhoh(data(i,j),cutoff)/float(nx)
      end do
      end do

      return
      end
